package com.server.transaction.example;

import com.server.transaction.annotation.SecureInvoke;
import org.springframework.stereotype.Service;

/**
 * @title: TransactionService
 * @author: gyuan
 * @description
 * @date: 2023-11-17 13:33
 */
@Service
public class TransactionService2 {

    @SecureInvoke(maxRetryTimes = 2, async = false, rollback = CheckResultHandle.class)
    public String test2() {
        double random = Math.random();
        String result = random > 0.5 ? "success" : "error";
        System.out.println("execute TransactionService2 method test2...and result is " + result);
        return result;
    }

}
